<template>
</template>

<script>

    import Auth from '@/lib/wechat.js';
	export default {
		components: {

		},
		data() {
			return {}
		},

		onLoad(option) {
			let snsapiBase = 'snsapi_userinfo';
			let urlData = location.pathname + '#/pages/login/wxLogin'+ location.search;
			console.log('urldata???',urlData);
			Auth.oAuth(snsapiBase, urlData);
			
		},
		methods: {
			// 解析URL 参数
			getUrlParam(name) {
				let reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
				let r = window.location.search.substr(1).match(reg)
				if (r != null) {
					return unescape(r[2])
				}
				return null
			},
			postCode(code)
			{
				login(code).then(res=>{
				    console.log('res>>>>code',JSON.stringify(res.data));
				})
			}
			
			
		}
	}
</script>

<style>
</style>
